list = [1,2,3,4]
count = 0
for b in list:
    for s in list:
        for g in list:
            if (b != s) & (b != g) & (s != g):
                count = count + 1
                print(b, end="")
                print(s, end="")
                print(g)
print('能组成%d个互不相同且无重复数字的三位数' % count)
